1. Field of the Invention
This invention relates to an apparatus and a method for processing a video signal. More specifically, this invention relates to an apparatus and a method for compressing a video signal.
2. Description of the Prior Art
Generally, a video signal is composed of a series of frames. Because of the effect of persistence of vision, a series of static pictures that are played back continuously is equivalent to a dynamic video signal for viewers. In general video signal processing systems, the frames in a video signal is compressed before being transmitted or stored. If the frames are not compressed first, the video signal would occupy large storage spaces and transmission bandwidth.
One characteristic of video signals is temporal redundancy, that is to say, in a video signal composed of a series of frames, there are usually high correlation and similarity between adjacent frames. Sometimes, most data in two adjacent frames are almost the same and there are only few differences.
To decrease the storage spaces or transmission bandwidth caused by temporal redundancy, there are two methods for encoding frames: full-image-encoding and adaptive-image-encoding. In a full-image-encoding mode, a frame is encoded without referring to other frames and is generally called an I-frame (intra-frame). In an adaptive-image-encoding mode, a frame is encoded with referring to frames adjacent to it and is generally called a P-frame (predictive frame) or B-frame (Bi-direction predictive frame). An encoded P-frame only includes the differences between the encoded frame and its reference frame. Therefore, P-frames generally have smaller data amounts than I-frames. On the contrast, P-frames cannot be decoded or regenerated without referring to its reference frame (might be an I-frame or an I-frame plus other P-frames).
In actual applications, although P-frames generally have smaller data amounts than I-frames, encoding most frames in an adaptive-image-encoding mode is not the best decision. Since every P-frame is compressed referring to adjacent I-frames or P-frames, if some frames are lost during transmissions, the following frames would not be decoded correctly until another I-frame is received. The aforementioned problem is named error propagation. To reduce the effect of error propagation, a parameter, video object plane (VOP), is specified in some video specifications. VOP represents a steady rate of generating I-frames. If the VOP is three, there are one I-frame and two P-frames among every three compressed frames.
In prior arts, the sequence of I-frame and P-frames is fixed after the VOP value is decided. For example, the first frame among every three compressed frames is set to be encoded in a full-image-encoding mode and the other two frames are set to be encoded in an adaptive-image-encoding mode. However, the selection of I-frames would affect the total data amount of a video signal. If I-frames are properly selected, the data amount of P-frames can be minimized. In prior arts, once the VOP value is decided, the sequence of I-frame and P-frames is fixed. In other words, the method of selecting I-frames in prior arts cannot guarantee the total data amount of a video signal is minimized.
Accordingly, this invention provides an apparatus and a method for processing a video signal. More specifically, the apparatus and method according to this invention can provide a minimum total data amount after compressing a video signal.